The present invention is directed to relatively high speed transfer of data from a universal serial bus peripheral device to a personal computer. In particular, the present invention includes a method and apparatus for compression of data transferred over a universal serial bus.
The universal serial bus (USB) is a computer bus architecture used for connection of information processing devices, such as peripheral computer devices to a personal computer (PC). For a number of reasons, use of a USB in peripheral device interconnection has become desirable. First, a wide range of information processing devices can be interconnected to other information processing devices, such as PCs, via the USB. For example, a PC""s keyboard, mouse, printer, scanner, modem, audio devices and video devices, can all be connected via the USB. Also, the USB allows connection of these and other peripheral devices using only a single connector type. Additionally, device attachment is automatically detected by the USB and software automatically configures the device for immediate use, without user intervention.
FIG. 1 is a schematic diagram showing an earlier data transfer configuration in a USB/PC interconnection. A USB device 12 can be a keyboard, mouse, video device such as a CCD camera, or any other peripheral information processing device which can be connected wit a PC 14 via a USB 15. A frame memory 16 is typically interconnected to USB device 12 to receive and temporarily store data therefrom. Frame memory 16 can be, for example, a first-in first-out memory (FIFO). A main control unit (MCU) 18 or central processing unit is connected to and controls the operation of the USB device 12, the frame memory 16 and the USB 15. It is also possible that a random access memory RAM 20 and program memory 22 be interconnected with the MCU. The RAM 20 and program memory 22 can be used for data compression as will be explained below. USB 15 includes a serial interface engine (SIE) 15a. SIE 15a transfers data initially generated by USB device 12 to PC 14.
To capture data from USB device 12 and transfer the data to PC 14, MCU 18 controls USB device 12 to capture the data. USB device 12 then transfers the data to frame memory 16. MCU 18 then takes the data from frame memory 16 and transfers it SIE 15a for transfer to PC 14. As shown in FIG. 2, SIE 15a includes a flip-flop 22, a USB clock 24 and processing electronics 23. The USB data is latched through input TX and output D+ of flip-flop 22 to processing electronics 23 for USB protocol processing and transfer to the PC 14. USB clock 24 sets the rate for latching data through to processing electronics 23.
USB clock can run at either a xe2x80x9cslowxe2x80x9d speed of about 1.5 MHz or a xe2x80x9cfastxe2x80x9d speed of about 12 MHz. The speed at which USB clock 24 is run depends upon the nature of USB device 12. For example, a typical keyboard or mouse would probably be run at 1.5 MHz while a typical video camera would probably be run at 12 MHz. In the data transfer configuration shown in FIG. 1, on each USB clock cycle, data is read from TX input of flip-flop 22 and transferred to D+ output of flip-flop 22. Processing electronics 23 reads data off the D+ output and, ultimately, the data is transferred to PC 14. FIG. 3 is a timing diagram showing the signals 32, 34, and 36 at D+, TX and USB CLK, respectively.
One of the tasks accomplished by processing electronics 23 is to place the USB data in xe2x80x9cframes.xe2x80x9d As shown in FIG. 3, under USB protocol, a frame 30 is a 1 millisecond (ms) interval in which data is transferred from the USB 15 to a PC 14. However, also under USB protocol, each frame ordinarily can contain a maximum of 1023 bytes of data. When USB device 20 transmits 1023 bytes of data every frame, the remainder of the frame is ordinarily not used for data transfer. Thus, as shown by arrows 31, running at 12 MHz, about 0.7 ms of the frame is used for data transfer while the remaining 0.3 ms is not.
It is often desirable that data from a peripheral device be transmitted relatively quickly to the PC to which the device is attached. And, in many cases, a relatively high transmission speed is desirable even at the expense of some resolution in the data. That is, it can be desirable to compress transferred data by discarding some data in order to gain speed in data acquisition. This can be the case, for example, when acquiring video or audio data from a peripheral device. In these types of signals, it is likely that a relatively lower transmission speed will have a greater effect on the ultimate quality of a sound or image than will relatively less, or reduced resolution, data.
Accordingly, it can be desirable to provide for compression of data from USB device 12 prior to routing data to PC 14. In the earlier data transfer circuit shown in FIG. 1, data compression is achieved through the use of RAM 20 and software stored in program memory 22. Data received from USB device 12 can be transferred to RAM 20 by MCU 18. A compression program stored in program memory 22 can then operate to compress data stored in RAM 20 and MCU 18 can then transfer the compressed data to USB 15. Generally, the compression program will act to remove some USB device data from that placed in RAM 20. Thus, because there is less data to transfer to PC 14, the transfer can take place more rapidly, facilitating a higher quality of sound or image to PC 14.
However, there are a number of drawbacks in use of the data transfer system shown in FIG. 1. First, even if data from USB device 12 is not being compressed, this data must be routed through MCU 18 prior to being fed into USB 15. This can result in relatively slow transmission time. And, as noted above, relatively high transmission time can be advantageous when the USB device generates an audio or video signal. Additionally, using software to compress data before feeding the data into the SIE requires additional processing time.
As this discussion makes clear, there is need for improvement in transmission and compression of data from a peripheral computer device to a PC via a USB. Specifically, data compression should be able to be completed without additional processing time to facilitate relatively high transmission rates.
The present invention provides a hardware method an apparatus for transmission and compression of data from a USB device to a computer. The data transmission method transmits data directly from a data output of the USB device to a serial interface engine if the USB. In this way, data can be advantageously transferred relatively rapidly from the USB device to the computer. A data compression method and apparatus in accordance with the present invention achieves data compression without additional overhead processing time. Thus, data transfer speed acquired through data compression is not sacrificed due to added processing time.
The present invention includes an apparatus for transferring data from a first information processing device to a second information processing device via a universal serial bus (USB). The apparatus includes a serial interface engine (SIE) connected to the second information processing devices. The SIE is for transferring data from the first information processing device to the second information processing device. A data output, which outputs data at a given clock rate, is interconnected with the first information processing device. A latch is connected with the SIE and directly connected the data output. The latch is for reading data transferred from the data output of the first information processing device into the SIE at a given clock frequency. At least one clock generator drives the latch such that data is transferred directly from the data output of the first information processing device to the SIE.
By directly transferring data from the data output to the SIE, without first passing the data through a main control unit (MCU) or central processing unit (CPU), relatively rapid data transfer is facilitated between the USB device and the computer. This can advantageously result in a relatively higher quality signal being transmitted from the USB device to the computer.
Another aspect of the present invention includes an apparatus for compressing data transferred from a first information processing device, such as a computer peripheral device, to a second information processing device, such as a computer, via a USB. The apparatus includes a serial interface engine (SIE) for connection to the second information processing device and transferring data from the first information processing device to the second information processing device. The apparatus also includes a first-in-first-out memory (FIFO) interconnected to the SIE and for storing and transferring data from the first information processing device to the SIE. The FIFO includes a data output for outputting data at a given clock frequency. A latch is interconnected with the SIE and the FIFO and reads data transferred from the FIFO into the SIE at a given clock frequency. A first clock generator drives the latch at a first frequency and a second clock generator at least intermittently drives the data output of the FIFO at a second frequency which is higher than the first frequency. When the output of the FIFO is driven at the second frequency, data is transmitted from the FIFO at a higher rate than is read by the latch.
In another aspect of the present invention, the output of the FIFO is driven only intermittently at the second frequency. Additionally, a buffer is placed between the FIFO and the latch. The buffer blocks transmission of data from the FIFO to the latch during the period of time when the output of the FIFO is driven at the second frequency. In this way, data can be dumped from the FIFO at whatever rate is desired and not latched into the SIE.
In yet another aspect of the present invention, a method of compressing data transferred from a first information processing device to a second information processing device via a USB includes temporarily storing data generated by the first information processing device in a FIFO which has a read output. Portions of the data are read from the read output of the FIFO into the input of a latch of an SIE. The SIE is for transferring the data to the second information processing device. The input of the latch is driven at a first clock frequency and the data output of the FIFO is driven at a second clock frequency which is at least intermittently different than the first clock frequency.
When the output of the FIFO is driven at a higher clock frequency than the input of the latch, some of the data stored by the FIFO is lost and the total amount of data transferred from the FIFO to the SIE is less than the amount of data generated by the first information processing device and stored in the FIFO. For example, if the output of the FIFO is driven at twice the frequency of the latch, then only half the data stored in the FIFO will be read into the SIE. This reduces the total amount of data transferred from the FIFO to the SIE which, in turn, advantageously reduces the total amount of time required to transfer the USB data. This can be accomplished without sacrificing any of the time reduction to processing overhead.